package cn.com.cifi.mars.mapper.mars;

import java.util.List;

import cn.com.cifi.mars.bean.bo.projecyByStages.FullPathOrgData;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import cn.com.cifi.mars.bean.dto.DivisionDto;
import cn.com.cifi.mars.bean.dto.ProjectByStagesDto;
import cn.com.cifi.mars.bean.dto.ProjectStagesDto;
import cn.com.cifi.mars.bean.vo.sys.rsp.ProjectVo;
import cn.com.cifi.mars.bean.vo.sys.rsp.StagesVo;
import cn.com.cifi.mars.entity.MdmProject;
import cn.com.cifi.mars.entity.common.ProjectByStages;

public interface ProjectByStagesMapper extends BaseMapper<ProjectByStages> {
	int deleteByPrimaryKey(String orgdepid);

	int insertSelective(ProjectByStages record);

	ProjectByStages selectByPrimaryKey(String orgdepid);

	int updateByPrimaryKeySelective(ProjectByStages record);

	int updateByPrimaryKey(ProjectByStages record);

	int deleteAll();
	
	void insetBatch(@Param("dataList")List<ProjectByStages> dataList);

	List<ProjectByStages> selectStagesList();

	int selectStagesNum(@Param("roleIds") List<String> roleIds, @Param("hrOrgTypeId") String hrOrgTypeId);

	List<ProjectByStagesDto> selectStagesOrgList(@Param("roleIds") List<String> roleIds,
			@Param("hrOrgTypeId") String hrOrgTypeId);

	List<ProjectByStagesDto> selectByOrgdepids(@Param("orgdepid") List<String> orgdepid);

	int selectStagesPositionNum(@Param("positionIds") List<String> positionIds,
			@Param("hrOrgTypeId") String hrOrgTypeId);

	List<ProjectByStagesDto> selectStagesPositionList(@Param("positionIds") List<String> positionIds,
			@Param("hrOrgTypeId") String hrOrgTypeId);

	List<ProjectByStagesDto> selectOrgnofullpathList(@Param("orgdepid") String orgdepid);

	/**
	 * 项目下拉框
	 * 
	 * @param orgdepid
	 * @param hrOrgTypeId
	 * @return
	 */
	List<ProjectVo> selectProjectList(@Param("orgdepid") String orgdepid,
			@Param("hrOrgTypeId") List<String> hrOrgTypeId);

	/**
	 * 分期下拉框
	 * 
	 * @param orgdepid
	 * @param hrOrgTypeId
	 * @return
	 */
	List<StagesVo> selectStagesVoList(@Param("orgdepid") String orgdepid, @Param("hrOrgTypeId") String hrOrgTypeId);

	/**
	 * 根据组织机构id查询项目id
	 * 
	 * @param hrOrgTypeIds
	 * @param orgdepid
	 * @return
	 */
	String selectByStagesId(@Param("hrOrgTypeIds") List<String> hrOrgTypeIds, @Param("orgdepid") String orgdepid);

	List<ProjectByStagesDto> selectStagesAllList(@Param("orgdepid") String orgdepid);

	ProjectByStagesDto selectByOrgdepid(@Param("orgdepid") String orgdepid);

	List<String> selectStagesId(@Param("roleIds") List<String> roleIds, @Param("hrOrgTypeId") String hrOrgTypeId);

	List<ProjectByStagesDto> selectRoleOrgList(@Param("orgdepids") List<String> orgdepids);

	List<ProjectByStagesDto> selectOrgParentList(@Param("orgdepids") List<String> orgdepids);

	List<String> selectStagesByPositionIds(@Param("positionIds") List<String> positionIds,
			@Param("hrOrgTypeId") String hrOrgTypeId);

	List<String> selectStagesByPositionGroupIds(@Param("orgdepids") List<String> orgdepids,
			@Param("hrOrgTypeId") String hrOrgTypeId);

	MdmProject selectByProjectId(@Param("projectId") String projectId);

	String selectRegionId(@Param("orgdepids") List<String> orgdepids, @Param("hrOrgTypeId") String hrOrgTypeId);

	String selectRegionName(@Param("orgdepids") List<String> orgdepids, @Param("hrOrgTypeId") String hrOrgTypeId);

	ProjectByStagesDto selectOrgParent(@Param("orgdepid") String orgdepid);

	/**
	 * 根据父级id查询子集id
	 * 
	 * @param orgId
	 * @return
	 */
	List<String> selectByParentOrgId(@Param("orgId") String orgId);

	ProjectByStages selectRegionByProjectId(@Param("projectId") String projectId);

	/**
	 * 根据orgid获取组织机构类型
	 * 
	 * @param orgId
	 * @return
	 */
	String selectHrOrgTypeIdByOrgdepId(@Param("orgId") String orgId);

	/**
	 * 根据全路径id 获取对应的类型的组织机构id
	 * 
	 * @return
	 */
	String selectHrOrgdepId(@Param("orgdepids") List<String> orgdepids, @Param("hrOrgTypeId") String hrOrgTypeId);

	List<ProjectStagesDto> selectProjectStageList(@Param("projectIds") List<MdmProject> projectIds,
			@Param("hrOrgTypeId") String hrOrgTypeId);

	/**
	 * 根据组织机构id集合查询不属于分期的信息
	 * 
	 * @param orgdepids
	 * @return
	 */
	List<ProjectByStagesDto> selectOrgNoStagesList(@Param("orgdepids") List<String> orgdepids,
			@Param("hrOrgTypeId") String hrOrgTypeId);

	/**
	 * 根据父级id和类型查询子集id
	 * 
	 * @param orgId
	 * @return
	 */
	List<ProjectByStagesDto> selectByOrgIdAndHrOrgTypeId(@Param("orgdepids") List<String> orgdepids,
			@Param("hrOrgTypeId") String hrOrgTypeId);

	List<DivisionDto> getOrgList(@Param("key") String key);

	List<DivisionDto> selectDivisionList(@Param("divisionIdList") List<String> divisionIdList);


    List<FullPathOrgData> selectFullPathOrgDataListList();

	List<ProjectByStagesDto> selectAllList();


}